<?php 
class factory{
    private static $classList = array();
    public static function getClass($class){
        if(!isset(static::$classList[$class])){
           static::$classList[$class] = new $class();
        }
        return static::$classList[$class];
    }
}




 ?>